<?php
	class Order_model extends CI_Model {
		public $table_name="orders";
   
    public function creat_one_order($address_id,$user_id)
    {
        $this->db->insert($this->table_name,array(
        		'address_id'=>$address_id,
        		'user_id'=>$user_id,
        		'creat_time'=>time()
        	));
        return $this->db->insert_id();
     }
     public function add_prodect_to_order($prodect_id,$num,$order_id){
     	$this->db->insert("order_prodect",array(
     			'prodect_id'=>$prodect_id,
     			'num'=>$num,
     			"order_id"=>$order_id
     		));
     }
}
    
